package com.ruoyi.framework.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author machenliang
 * @date 2024-06-06 9:20
 */
@Slf4j
@Component("transTask")
public class TransTask {

    public void pullData() {
        log.info("pullData");
//        try {
//            String dataPath = "/" + DateUtils.datePath();
//            String downloadPath = RuoYiConfig.getDownloadPath();
//            log.info("下载目录:{}", downloadPath + dataPath);
//            List<File> files = FileUtil.loopFiles(downloadPath + dataPath);
//            List<File> zips = files.stream().filter(item -> FileUtil.extName(item).equals("zip")).collect(Collectors.toList());
//            for (File file : zips) {
//
//                MultipartFile multipartFile = FileUtils.getMultipartFile(file);
//                FileUploadUtils.uploadMinio(multipartFile);
//            }
//
//        } catch (IOException e) {
//            throw new RuntimeException(e);
//        }
    }

    public void pushData() {
        System.out.println("push data to inner server");
    }
}
